import uvicorn
from fastapi import FastAPI

app = FastAPI()

@app.get("/",tags=["接口标题A"],summary="接口描述",
         description="接口详情",response_description="响应详情")
async def test_get():
    return {"message": "你好，GET！"}

@app.post("/",deprecated=True)  # 废弃
async def test_post():
    return {"message": "你好，POST！"}
@app.put("/")
async def test_put():
    return {"message": "你好，PUT！"}
@app.delete("/")
async def test_delete():
    return {"message": "你好，DELETE！"}


# 命令行启动：uvicorn 02FastAPI:app --reload
# 代码启动：
if __name__ == '__main__':
    uvicorn.run('04装饰器参数:app',port=8080,reload=True)